<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{_fragments::common_header(~{::title})}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
    <link href="../../static/css/bootstrap.min.css" th:href="@{/static/css/bootstrap.min.css}" rel="stylesheet">
    <script src="../../static/js/jquery-3.2.1.js" th:src="@{/static/js/jquery-3.2.1.js}"></script>
    <script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}"></script>
    <title>逍遥论坛 › 用户个人信息</title>
</head>
<body>

<!-- 弹出结果 -->
<c:if test="${not empty myInfo}">
    <script type="text/javascript" language="javascript">
        {
            alert("<%=request.getAttribute("myInfo")%>");
        }
    </script>
</c:if>

<!-- 引入header文件 -->
<header th:replace=" _fragments:: header"></header>

<div style="width: 70%;margin:1% 2% 1% 5%;float: left;">
    <div class="panel panel-default" id="main" style="">
        <div class="panel-heading" style="background-color: white">
            <a href="<%=basePath%>">逍遥论坛</a> › 用户信息 ›
            <a href="<%=basePath%>" th:if="${userInfo.userNick==null||userInfo.userNick==''}" th:text="${userInfo.userName}"></a> 
            <a href="<%=basePath%>" th:if="${userInfo.userNick!=null||userInfo.userNick!=''}" th:text="${userInfo.userNick}"></a> 
           <!--  <c:choose>
                <c:when test="${empty userObject.user_nick}">${userObject.user_name}</c:when>
                <c:otherwise>${userObject.user_nick}</c:otherwise>
            </c:choose> -->
        </div>

        <div class="panel-body">
            <c:if test="${!empty userObject}">
            <form class="form-horizontal" role="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label">用户ID</label>
                    <div class="col-sm-10">
                        <p class="form-control-static" th:text="${userInfo.userId}">${userObject.user_id}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-10">
                        <p class="form-control-static" th:text="${userInfo.userName}">${userObject.user_name}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">昵称</label>
                    <div class="col-sm-10">
                        <p class="form-control-static" th:text="${userInfo.userNick}">${userObject.user_nick}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-10">
                        <p class="form-control-static" th:switch="${userInfo.userStatus}">
                            <span th:case="1">禁用</span>
                            <span th:case="2">锁定</span>
                            <span th:case="*">正常</span>
                           <!-- <c:choose>
                                <c:when test="${userObject.user_status == 1}"></c:when>
                                <c:when test="${userObject.user_status == 2}">锁定</c:when>
                                <c:otherwise>正常</c:otherwise>
                            </c:choose>-->
                        </p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">用户权限</label>
                    <div class="col-sm-10">
                        <p class="form-control-static" th:switch="${userInfo.userType}">
                         	<span th:case="0">超级管理员</span>
                            <span th:case="1">管理员</span>
                            <span th:case="2">普通用户</span>
                           <!--  <c:choose>
                                <c:when test="${userObject.user_type == 0}">超级管理员</c:when>
                                <c:when test="${userObject.user_type == 1}">管理员</c:when>
                                <c:when test="${userObject.user_type == 2}">普通用户</c:when>
                                <c:otherwise></c:otherwise>
                            </c:choose> -->
                        </p>
                    </div>
                </div>
                <!-- 只有自己才能修改个人信息，查看别人时不能修改他人的信息 -->
               <!--  <c:if test="${userObject.user_id == USER.user_id}">&nbsp;&nbsp; -->
                    <a class="btn btn-warning" role="button"
                       th:href="'toUpdateUserInfoPage.do?userId='+${userInfo.userId}" th:if="${userInfo.userId==session.user.userId}" >修改资料</a>
               <!-- </c:if> -->
                <input type="button" class="btn btn-default" value="返回"
                       style="margin-left: 20%" onclick="window.location.href='toMainPage.do'" />
            </form>
            </c:if>

        </div>
    </div>
</div>

<!-- 引入侧边栏文件 -->
<nav th:replace="side:: nav"></nav>

<!-- 引入footer文件 -->
<footer th:replace="_fragments:: footer"></footer>

</body>
</html>